import re
import time
import requests
import uuid

url_page  = "https://mm.enterdesk.com/dongmanmeinv/"
#发送请求
ret = requests.get(url=url_page) #ret是html的响应对象
# print(ret.text)  #ret.text是html的字符串形式

url_list = re.findall(r'https://up.enterdesk.com/edpic_360_360.*?\.jpg',ret.text)
print(url_list)
for url in url_list:
    #转换二进制流
    res = requests.get(url=url)
    time.sleep(2)
    content = res.content
    #将二进制流写入文件
    name =str(uuid.uuid1())+'.jpg'
    with open(name,'wb') as f:
        print('正在下载%s' % name)
        f.write(content)








































